package org.tigris.subversion.svnant.types;

import java.io.File;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.DirectoryScanner;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.types.AbstractFileSet;
import org.apache.tools.ant.types.FileSet;
import org.apache.tools.ant.types.Reference;
import org.tigris.subversion.svnant.SvnFacade;

public class SvnFileSet extends FileSet
{
  private static final String MSG_DEPRECATION = "Deprecated attribute '%s'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.";

  public SvnFileSet()
  {
  }

  protected SvnFileSet(SvnFileSet paramSvnFileSet)
  {
    SvnFacade.setJavahl(this, SvnFacade.getJavahl(paramSvnFileSet));
  }

  public synchronized Object clone()
  {
    SvnFileSet localSvnFileSet = (SvnFileSet)super.clone();
    return localSvnFileSet;
  }

  public void setJavahl(boolean paramBoolean)
  {
    warning("Deprecated attribute '%s'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.", new Object[] { "javahl" });
    SvnFacade.setJavahl(this, paramBoolean);
  }

  public void setSvnkit(boolean paramBoolean)
  {
    warning("Deprecated attribute '%s'. This attribute will disappear with SVNANT 1.3.2. Use svnSetting instead.", new Object[] { "javahl" });
    SvnFacade.setSvnKit(this, paramBoolean);
  }

  public DirectoryScanner getDirectoryScanner(Project paramProject)
  {
    if (isReference())
      return getRef(paramProject).getDirectoryScanner(paramProject);
    File localFile = getDir(paramProject);
    boolean bool = false;
    if (localFile == null)
      throw new BuildException("No directory specified for " + getDataTypeName() + ".");
    if (!localFile.exists())
      throw new BuildException(localFile.getAbsolutePath() + " not found.");
    if (!localFile.isDirectory())
      throw new BuildException(localFile.getAbsolutePath() + " is not a directory.");
    SvnDirScanner localSvnDirScanner = new SvnDirScanner(SvnFacade.getClientAdapter(this));
    setupDirectoryScanner(localSvnDirScanner, paramProject);
    localSvnDirScanner.setFollowSymlinks(bool);
    localSvnDirScanner.scan();
    return localSvnDirScanner;
  }

  public void setRefid(Reference paramReference)
    throws BuildException
  {
    throw ((BuildException)notSupported("refid", true).fillInStackTrace());
  }

  public void setFollowSymlinks(boolean paramBoolean)
  {
    throw ((BuildException)notSupported("followSymlinks", true).fillInStackTrace());
  }

  private BuildException notSupported(String paramString, boolean paramBoolean)
  {
    StringBuffer localStringBuffer = new StringBuffer();
    localStringBuffer.append(getProject().getElementName(this)).append(" doesn't support the ");
    if (paramBoolean)
      localStringBuffer.append(paramString).append(" attribute.");
    else
      localStringBuffer.append("nested ").append(paramString).append(" element.");
    return new BuildException(localStringBuffer.toString());
  }

  private void warning(String paramString, Object[] paramArrayOfObject)
  {
    getProject().log(String.format(paramString, paramArrayOfObject), 1);
  }
}

/* Location:           C:\Users\Administrator\Desktop\svnant.jar
 * Qualified Name:     org.tigris.subversion.svnant.types.SvnFileSet
 * JD-Core Version:    0.6.0
 */